package com.ssy.lingxi.platform.manage.model.response;

import com.ssy.lingxi.common.utils.DateTimeUtil;
import com.ssy.lingxi.platform.manage.entity.base.AppVersionManager;
import lombok.Getter;
import lombok.Setter;

/**
 * @author wyx
 * @version 2.0.0
 * @date 2021-11-17
 */
@Setter
@Getter
public class AppVersionManagerRes {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 版本号
     */
    private String version;

    /**
     * 发布时间
     */
    private String releaseTime;

    /**
     * 升级类型：1、强制更新 2、非强制更新
     */
    private Integer type;

    /**
     * 升级内容
     */
    private String content;

    /**
     * APP安装包下载地址
     */
    private String installPack;

    public AppVersionManagerRes(AppVersionManager versionManager) {
        this.id = versionManager.getId();
        this.version = versionManager.getVersion();
        this.releaseTime = DateTimeUtil.formatDateTime(versionManager.getReleaseTime());
        this.type = versionManager.getType();
        this.content = versionManager.getContent();
        this.installPack = versionManager.getInstallPack();
    }
}
